package com.yonyou.cyxdms.basedata.service.repository.configurer;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yonyou.cyx.framework.dao.base.SuperMapper;
import com.yonyou.cyxdms.basedata.client.domains.vo.PackageCacheVO;
import com.yonyou.cyxdms.basedata.service.entity.configurer.PackagePO;
import com.yonyou.cyxdms.basedata.service.vo.model.ModelDictVO;
import com.yonyou.cyxdms.basedata.service.vo.packages.PackageDictVO;
import com.yonyou.cyxdms.basedata.service.vo.packages.VehicleProductPackageVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 配置 Mapper 接口
 * </p>
 *
 * @author renwd
 * @since 2018-12-11
 */
public interface PackageMapper extends SuperMapper<PackagePO> {

    List<PackageCacheVO> queryPackageByCondition(@Param("params") Map<String, Object> queryParam);

    /**
     * 根据车型Id查询车辆配置信息
     *
     * @param modelId
     * @param appId
     * @param groupCode
     * @return java.util.List<com.yonyou.cyxdms.basedata.client.domains.DTO.basedata.PackageCacheVO>
     * @author guorp
     * @since 2018/12/13
     */
    List<PackageCacheVO> getPackageByModelId(@Param("modelId") Long modelId, @Param("appId") String appId, @Param("groupCode") String groupCode);

    /**
     * 查询配置信息（pc）
     *
     * @param queryParam
     * @return java.util.List<com.yonyou.cyxdms.basedata.service.vo.packages.VehicleProductPackageVO>
     * @author renwd
     * @since 2019/7/10
     */
    List<VehicleProductPackageVO> queryVehicleProductPackage(IPage page, @Param("params") Map<String, Object> queryParam);

    /**
     * dcs查询配置信息
     *
     * @param page
     * @param queryParam
     * @return java.util.List<com.yonyou.cyxdms.basedata.service.vo.packages.VehicleProductPackageVO>
     * @author renwd
     * @since 2019/7/18
     */
    List<VehicleProductPackageVO> queryVehicleProductDcsPackage(IPage page, @Param("params") Map<String, Object> queryParam);

    /**
     * 导出配置
     *
     * @param queryParam
     * @return java.util.List<java.util.Map>
     * @author renwd
     * @since 2019/7/15
     */
    List<Map> exportExcelForPackage(@Param("params") Map<String, Object> queryParam);

    /**
     * 配置下拉框查询
     *
     * @param queryParam
     * @return java.util.List<com.yonyou.cyxdms.basedata.service.vo.packages.PackageDictVO>
     * @author renwd
     * @since 2019/7/16
     */
    List<PackageDictVO> queryPackageDict(@Param("params") Map<String, Object> queryParam);

    /**
     * @Description: 有效配置下拉框
     * @Param: [modelId, appId]
     * @Return: java.util.List<com.yonyou.cyxdms.basedata.service.vo.packages.PackageDictVO>
     * @Author: lijun
     * @Date: 16:06 2019/8/22
     **/
    List<PackageDictVO> getPackageDict(@Param("appId") String appId,
                                       @Param("modelId") Long modelId);

    /**
     * @Description: 根据Code获取配置
     * @Param: [modelId, appId, packageCode]
     * @Return: com.yonyou.cyxdms.basedata.service.vo.packages.PackageDictVO
     * @Author: lijun
     * @Date: 16:06 2019/8/22
     **/
    PackageDictVO getByCode(@Param("appId") String appId,
                            @Param("modelId") Long modelId,
                            @Param("packageCode") String packageCode);

    PackageDictVO getByCodeOnly(@Param("appId") String appId, @Param("packageCode") String packageCode);

    List<Long> getIdListByCondition(@Param("configName") String configName);

    PackagePO getByAppIdAndCode(@Param("appId") String appId,
                                @Param("packageCode") String packageCode);

    VehicleProductPackageVO getByPackId(@Param("appId") String appId,
                                @Param("packageCode") String packageCode);

    List<VehicleProductPackageVO> queryPackageDictAll(@Param("params") Map<String, Object> queryParam);

    List<VehicleProductPackageVO> queryVehicleProductPackage(@Param("params") Map<String, Object> queryParam);

}
